package demo1228.homework;

import java.io.*;

/*
转换流的复制
 */
public class Demo_01 {
    public static void main(String[] args)  {
        File file=new File("a.txt");
        boolean b= false;
        try {
            b = file.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(b);
        try (InputStreamReader fw = new InputStreamReader(new FileInputStream("a.txt"));
             OutputStreamWriter fe=new OutputStreamWriter(new FileOutputStream("b.txt"))) {
            int read;
            while ((read=fw.read())!=-1){
                fe.write(read);

            }
            fe.flush();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
